<%@ include file="../commons/header.jsp" %>

<div class="outerwrap"> 
	
	<div id="centrecontent"><!-- centrecontent -->
		<div>
		<form action="identity_register_register.action" method="post" onsubmit="jsLab_SetValue();">
		<table width="100%" class="nobordertable">
			<tr>
				<td width="15%"></td>
				<td>
					<s:if test="message!=null">
					<div class="errorDiv">
						<s:property value="message" />
					</div>
					</s:if>
				</td>
			</tr>
			<tr>
				<td colspan="2" align="center"><fmt:message key="html.register"/></td>
			</tr>
			<tr>
				<td align="right"><label class="redFont">*</label><fmt:message key="user.email"/></td>
				<td><input id="user.email" type="text" name="user.email" value="<c:out value="${user.email }"/>"/>
				<c:out value="${fieldErrors['user.email']}"/></td>				
			</tr>
			<tr>
				<td></td>
				<td><input type="button" value="<fmt:message key="html.checkUserExist" />" onclick="chechUserExist();"/>
				<img id="load" style="display: none;" alt="Loading..." src="<c:url value="../images/spinner.gif"/>">
				<label id="checkResult"></label>							
				</td>
			</tr>
			<tr>
				<td align="right"><label class="redFont">*</label><fmt:message key="user.password"/></td>
				<td><input type="password" name="user.password"/>
				<s:property value="%{fieldErrors['user.password']}"/></td>
			</tr>
			<tr>
				<td align="right"><label class="redFont">*</label><fmt:message key="user.confirmPassword"/></td>
				<td><input type="password" name="confirmPassword"/><s:property value="%{fieldErrors['confirmPassword']}"/></td>
			</tr>
			<tr>
				<td align="right"><fmt:message key="user.name"/></td>
				<td><input type="text" name="user.name" value="<c:out value="${user.name }"/>"/></td>
			</tr>
			<tr>
				<td align="right"><label class="redFont">*</label><fmt:message key="user.question"/></td>
				<td><select name="user.question" id="select_dom">
						<option value="<fmt:message key="user.question.1"/>"><fmt:message key="user.question.1"/></option>
						<option value="<fmt:message key="user.question.2"/>"><fmt:message key="user.question.2"/></option>
						<option value="<fmt:message key="user.question.3"/>"><fmt:message key="user.question.3"/></option>
						<option value="<fmt:message key="user.question.4"/>"><fmt:message key="user.question.4"/></option>
					</select><s:property value="%{fieldErrors['user.question']}"/>
				</td>				
			</tr>
			<tr>
				<td align="right"><label class="redFont">*</label><fmt:message key="user.answer"/></td>
				<td><input type="text" name="user.answer" value="<c:out value="${user.answer }"/>"/>
				<s:property value="%{fieldErrors['user.answer']}"/></td>
			</tr>
			<tr>
				<td colspan="2" align="center">
					<input name="submit" type="reset" value="<fmt:message key="html.reset"/>"/>
					<input name="submit" type="submit" value="<fmt:message key="html.submit"/>">
				</td>
			</tr>
			<tr>
				<td align="center" colspan="2">
				<hr align="center" noshade="noshade" width="90%" size="1">
				</td>
			</tr>
			<tr>
				<td align="center" colspan="2">
				<a href="#"><fmt:message key="html.agreement"/></a>
				</td>
			</tr>
		</table>
</form>
		</div>
	</div><!-- /centrecontent -->
	
	<div id="left"><!-- left -->
	</div><!-- /left -->
	
	<div class="clearer"></div>
</div>
			
<!--end outer wrap -->
<div id="right"><!-- right -->

</div><!-- /right -->
<div class="clearer"></div>


<script type="text/javascript">
function chechUserExist(){
	var pars = Form.Element.serialize($('user.email'));
	var url = "identity_check.action";
	
	if($F('user.email')==""){
		alert('1');
	}else{
		var myAjax = new Ajax.Request(
                    url,{method:'post',
                    parameters:pars,
                    onLoading:showDiv,
                    onComplete:showResponse,
                    onFailure:reportError})
	}
}
function showResponse(originalRequest){               
	Element.hide($('load'));
	$('checkResult').innerHTML=originalRequest.responseText;
	///alert(originalRequest.responseText);
	Field.focus($('user.email'));   
                
}    
function showDiv(){         
	Element.show($('load')); 
}  
function reportError(){    
	alert('error');    
}
</script>
<%@ include file="../commons/footer.jsp" %>